<?php
class Zendvn_Validate_Url extends Zend_Validate_Abstract{

	const URL_INVALID  = 'urlInvalid';
    
    protected $_messageTemplates = array(
        self::URL_INVALID   => "'%value%' is not Url address",        
    );
    
	
	public function isValid($value){	
			
		if (!preg_match('#(http|https)://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?#i', $value)){
			$this->_error(self::URL_INVALID,$value);
			return false;
		}
		return true;
	}
}